/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI.MAINMENU;

import java.awt.Color;
import java.awt.Component;

/**
 *
 * @author wonka
 */
public class Home extends org.jdesktop.swingx.JXPanel {
 private Color customerColor,passBookColor,billColor,reportColor;

    /**
     * Creates new form Home
     */
    public Home() {
        initComponents();
        customerColor = new Color( pn_Customer.getBackground().getRGB());
        passBookColor = new Color( pn_PassBook.getBackground().getRGB());
        billColor = new Color( pn_Bill.getBackground().getRGB());
        reportColor = new Color( pn_Report.getBackground().getRGB());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jXLabel1 = new org.jdesktop.swingx.JXLabel();
        mainCustomerPanel = new org.jdesktop.swingx.JXPanel();
        pn_PassBook = new org.jdesktop.swingx.JXPanel();
        jXLabel3 = new org.jdesktop.swingx.JXLabel();
        pn_Bill = new org.jdesktop.swingx.JXPanel();
        jXLabel7 = new org.jdesktop.swingx.JXLabel();
        pn_Report = new org.jdesktop.swingx.JXPanel();
        jXLabel4 = new org.jdesktop.swingx.JXLabel();
        pn_Customer = new org.jdesktop.swingx.JXPanel();
        lb_Customer = new org.jdesktop.swingx.JXLabel();

        setBackground(new java.awt.Color(255, 253, 218));
        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setAutoscrolls(true);
        setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.FIT);
        setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.FIT);
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                formComponentResized(evt);
            }
        });

        jXLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Medium_Home.png"))); // NOI18N
        jXLabel1.setText("HOME");
        jXLabel1.setFont(new java.awt.Font("Segoe WP", 0, 36)); // NOI18N

        mainCustomerPanel.setBackground(new java.awt.Color(255, 253, 218));
        mainCustomerPanel.setPreferredSize(new java.awt.Dimension(686, 470));
        mainCustomerPanel.setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        mainCustomerPanel.setScrollableTracksViewportHeight(true);
        mainCustomerPanel.setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        mainCustomerPanel.setLayout(new java.awt.GridBagLayout());

        pn_PassBook.setBackground(new java.awt.Color(240, 90, 34));
        pn_PassBook.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "SỔ TIẾT KIỆM", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 3, 14))); // NOI18N
        pn_PassBook.setPreferredSize(new java.awt.Dimension(300, 220));
        pn_PassBook.setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_PassBook.setScrollableTracksViewportHeight(true);
        pn_PassBook.setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_PassBook.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pn_PassBookMouseExited(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pn_PassBookMouseClicked(evt);
            }
        });
        pn_PassBook.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                pn_PassBookMouseMoved(evt);
            }
        });

        jXLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Big_PassBook.png"))); // NOI18N

        javax.swing.GroupLayout pn_PassBookLayout = new javax.swing.GroupLayout(pn_PassBook);
        pn_PassBook.setLayout(pn_PassBookLayout);
        pn_PassBookLayout.setHorizontalGroup(
            pn_PassBookLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_PassBookLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(150, Short.MAX_VALUE))
        );
        pn_PassBookLayout.setVerticalGroup(
            pn_PassBookLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_PassBookLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 140;
        gridBagConstraints.ipady = 41;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 10, 0, 19);
        mainCustomerPanel.add(pn_PassBook, gridBagConstraints);

        pn_Bill.setBackground(new java.awt.Color(178, 210, 52));
        pn_Bill.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "TÍN PHIẾU", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 3, 14))); // NOI18N
        pn_Bill.setPreferredSize(new java.awt.Dimension(300, 220));
        pn_Bill.setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Bill.setScrollableTracksViewportHeight(true);
        pn_Bill.setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Bill.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pn_BillMouseExited(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pn_BillMouseClicked(evt);
            }
        });
        pn_Bill.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                pn_BillMouseMoved(evt);
            }
        });

        jXLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Big_Bills.png"))); // NOI18N

        javax.swing.GroupLayout pn_BillLayout = new javax.swing.GroupLayout(pn_Bill);
        pn_Bill.setLayout(pn_BillLayout);
        pn_BillLayout.setHorizontalGroup(
            pn_BillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_BillLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jXLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(140, Short.MAX_VALUE))
        );
        pn_BillLayout.setVerticalGroup(
            pn_BillLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_BillLayout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jXLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 130;
        gridBagConstraints.ipady = 31;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 14, 16, 0);
        mainCustomerPanel.add(pn_Bill, gridBagConstraints);

        pn_Report.setBackground(new java.awt.Color(192, 23, 44));
        pn_Report.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "BÁO CÁO", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 3, 14))); // NOI18N
        pn_Report.setPreferredSize(new java.awt.Dimension(300, 220));
        pn_Report.setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Report.setScrollableTracksViewportHeight(true);
        pn_Report.setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Report.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pn_ReportMouseExited(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pn_ReportMouseClicked(evt);
            }
        });
        pn_Report.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                pn_ReportMouseMoved(evt);
            }
        });

        jXLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Big_Report.png"))); // NOI18N

        javax.swing.GroupLayout pn_ReportLayout = new javax.swing.GroupLayout(pn_Report);
        pn_Report.setLayout(pn_ReportLayout);
        pn_ReportLayout.setHorizontalGroup(
            pn_ReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_ReportLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(150, Short.MAX_VALUE))
        );
        pn_ReportLayout.setVerticalGroup(
            pn_ReportLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_ReportLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.ipadx = 140;
        gridBagConstraints.ipady = 41;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 10, 16, 19);
        mainCustomerPanel.add(pn_Report, gridBagConstraints);
        pn_Report.getAccessibleContext().setAccessibleName("");

        pn_Customer.setBackground(new java.awt.Color(0, 112, 180));
        pn_Customer.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "KHÁCH HÀNG", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI Light", 3, 14))); // NOI18N
        pn_Customer.setPreferredSize(new java.awt.Dimension(300, 220));
        pn_Customer.setScrollableHeightHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Customer.setScrollableTracksViewportHeight(true);
        pn_Customer.setScrollableWidthHint(org.jdesktop.swingx.ScrollableSizeHint.PREFERRED_STRETCH);
        pn_Customer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                pn_CustomerMouseExited(evt);
            }
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                pn_CustomerMouseClicked(evt);
            }
        });
        pn_Customer.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                pn_CustomerMouseMoved(evt);
            }
        });

        lb_Customer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Big_Customer.png"))); // NOI18N

        javax.swing.GroupLayout pn_CustomerLayout = new javax.swing.GroupLayout(pn_Customer);
        pn_Customer.setLayout(pn_CustomerLayout);
        pn_CustomerLayout.setHorizontalGroup(
            pn_CustomerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_CustomerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lb_Customer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(150, Short.MAX_VALUE))
        );
        pn_CustomerLayout.setVerticalGroup(
            pn_CustomerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pn_CustomerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lb_Customer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(52, Short.MAX_VALUE))
        );

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 140;
        gridBagConstraints.ipady = 41;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints.insets = new java.awt.Insets(11, 14, 0, 0);
        mainCustomerPanel.add(pn_Customer, gridBagConstraints);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(mainCustomerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 643, Short.MAX_VALUE)
                    .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jXLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(mainCustomerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
                .addGap(66, 66, 66))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void pn_CustomerMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_CustomerMouseMoved
        // TODO add your handling code here:
       pn_Customer.setBackground(Color.YELLOW);
    }//GEN-LAST:event_pn_CustomerMouseMoved

    private void pn_CustomerMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_CustomerMouseExited
        // TODO add your handling code here:
        pn_Customer.setBackground(customerColor);
    }//GEN-LAST:event_pn_CustomerMouseExited

    private void pn_PassBookMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_PassBookMouseMoved
        // TODO add your handling code here:
        pn_PassBook.setBackground(Color.YELLOW);
    }//GEN-LAST:event_pn_PassBookMouseMoved

    private void pn_PassBookMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_PassBookMouseExited
        // TODO add your handling code here:
         pn_PassBook.setBackground(passBookColor);
    }//GEN-LAST:event_pn_PassBookMouseExited

    private void pn_BillMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_BillMouseMoved
        // TODO add your handling code here:
          pn_Bill.setBackground(Color.YELLOW);
    }//GEN-LAST:event_pn_BillMouseMoved

    private void pn_BillMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_BillMouseExited
        // TODO add your handling code here:
        pn_Bill.setBackground(billColor);
    }//GEN-LAST:event_pn_BillMouseExited

    private void pn_ReportMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_ReportMouseMoved
        // TODO add your handling code here:
          pn_Report.setBackground(Color.YELLOW);
    }//GEN-LAST:event_pn_ReportMouseMoved

    private void pn_ReportMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_ReportMouseExited
        // TODO add your handling code here:
         pn_Report.setBackground(reportColor);
    }//GEN-LAST:event_pn_ReportMouseExited

    private void pn_CustomerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_CustomerMouseClicked
        // TODO add your handling code here:
        MenuCustomer customer = new MenuCustomer();
        customer.setVisible(true);
        customer.setSize( this.getSize());
         this.removeAll();
        this.add(customer);
        this.validate();
        this.repaint();
        
    }//GEN-LAST:event_pn_CustomerMouseClicked

    private void pn_PassBookMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_PassBookMouseClicked
        // TODO add your handling code here:
         MenuPassBook child = new MenuPassBook();
        child.setVisible(true);
        child.setSize( this.getSize());
         this.removeAll();
        this.add(child);
        this.validate();
        this.repaint();
    }//GEN-LAST:event_pn_PassBookMouseClicked

    private void pn_BillMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_BillMouseClicked
        // TODO add your handling code here:
         MenuTruthBill child = new MenuTruthBill();
        child.setVisible(true);
        child.setSize( this.getSize());
         this.removeAll();
        this.add(child);
        this.validate();
        this.repaint();
    }//GEN-LAST:event_pn_BillMouseClicked

    private void pn_ReportMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_pn_ReportMouseClicked
        // TODO add your handling code here:
          MenuReport child = new MenuReport();
        child.setVisible(true);
        child.setSize( this.getSize());
         this.removeAll();
        this.add(child);
        this.validate();
        this.repaint();
    }//GEN-LAST:event_pn_ReportMouseClicked

    private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
        // TODO add your handling code here:
           Component c = this.getComponent(0);
        c.resize(this.getSize());
        c.setPreferredSize(this.getPreferredSize());
        c.revalidate();
        c.repaint();
    }//GEN-LAST:event_formComponentResized

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXLabel jXLabel1;
    private org.jdesktop.swingx.JXLabel jXLabel3;
    private org.jdesktop.swingx.JXLabel jXLabel4;
    private org.jdesktop.swingx.JXLabel jXLabel7;
    private org.jdesktop.swingx.JXLabel lb_Customer;
    private org.jdesktop.swingx.JXPanel mainCustomerPanel;
    private org.jdesktop.swingx.JXPanel pn_Bill;
    private org.jdesktop.swingx.JXPanel pn_Customer;
    private org.jdesktop.swingx.JXPanel pn_PassBook;
    private org.jdesktop.swingx.JXPanel pn_Report;
    // End of variables declaration//GEN-END:variables
}
